package com.company.gas.service.impl;


import com.company.gas.mapper.ICMapper;
import com.company.gas.pojo.IC;
import com.company.gas.service.IICService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ICServiceImpl implements IICService {

    @Autowired
    private ICMapper icMapper;

    @Override
    public List<IC> queryICList() {
        List<IC> icList = icMapper.selectAll();
        for(IC ic : icList){
            System.out.println(ic);
        }
        return icList;
    }

    @Override
    public IC queryICRemainById(String icId) {
        IC ic =icMapper.queryICRemainById(icId);
        System.out.println(ic);
        return ic;
    }

    @Override
    public int newIC(String icId, String cusId, String remainder, Integer flag, Date createTime, String createBy, Date modifyTime, String modifyBy) {
        icMapper.newIC(icId,cusId,remainder,flag,createTime,createBy,modifyTime,modifyBy);
        return 1;
    }

    @Override
    public int updateIC(String cusId, String remainder, Date modifyTime, String modifyBy) {
        icMapper.updateIC(cusId,remainder, modifyTime,modifyBy);
        return 1;
    }

    @Override
    public int deleteIC(String icId) {
        icMapper.deleteIC(icId);
        return 1;
    }

}